(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('cda.feeCode.viewController', viewController);
	viewController.$inject = [ '$scope', 'Constants', 'layoutConfig', 'validatorConfig', 'gridService', 'authService', 'feeCodeService' ];
	function viewController($scope, Constants, layoutConfig, validatorConfig, gridService, authService, feeCodeService) {
		var ctrl = this, feeCodeInfo = $scope.$stateParams.params;
//		ctrl.layoutConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;
		ctrl.feeCode = {};
		ctrl.init = function() {			
			// init tier criteria
			feeCodeService.initTierCriteria(layoutConfig, $scope, ctrl, true);
			// init options
			feeCodeService.initOptionData(ctrl, $scope, true).then(function() {
				authService.view(feeCodeInfo).then(function(response) {
					var initFeeCode = response.data || {};
					initFeeCode.action = 'view';
					feeCodeService.initLayoutAndModel($scope, ctrl, initFeeCode, layoutConfig, true).then(function() {
					});
				});
			});
		};
	}
})(angular);